//
//  VarArgs.m
//  Varargs
//
//  Created by Ge Jian Feng on 14-5-29.
//  Copyright (c) 2014年 Ge Jian Feng. All rights reserved.
//

#import "VarArgs.h"

@implementation VarArgs

- (void)test:(NSString *)name, ...
{
    va_list argList;
    
    if (name) {
        NSLog(@"%@", name);
        
        va_start(argList, name);
        NSString *arg = va_arg(argList, id);
        while (arg) {
            NSLog(@"%@", arg);
            arg = va_arg(argList, id);
        }
        va_end(argList);
    }
}

@end
